package com.example.Laboratory.Mapper;

import com.example.Laboratory.Entity.Train;
import org.apache.ibatis.annotations.*;

import java.util.List;


@Mapper
public interface TrainMapper {

    //增加大创训练成果信息
    @Insert("INSERT INTO train(train_name,train_grade,train_person,train_teacher,train_time)VALUES(#{train_name},#{train_grade},#{train_person},#{train_teacher},#{train_time})")
    int addTrain (Train t);

    //根据id删除大创训练成果信息
    @Delete("DELETE FROM train WHERE train_id=#{train_id}")
    int deleteTrain (int train_id);

    //查找全表大创训练成果信息
    @Select("SELECT * FROM train")
    List<Train> researchTrain ( );


    //修改大创训练成果信息
    @Update("UPDATE train SET train_name=#{train_name},train_grade=#{train_grade},train_person=#{train_person},train_teacher=#{train_teacher},train_time=#{train_time} WHERE train_id=#{train_id}")
    int reviseTrain (Train t);
}
